package br.eng.eliseu.gwt.gestaoWeb.server.command.generico;

import br.eng.eliseu.gwt.gestaoWeb.model.BaseEntity;
import br.eng.eliseu.gwt.gestaoWeb.server.command.BaseCommand;

import com.google.inject.persist.Transactional;

public class DeleteEntityCommand extends BaseCommand<Boolean> /*implements Callable<Boolean>*/{
//	@Inject EntityManager em;
	
	private static final long serialVersionUID = -1397625666167586506L;
	private BaseEntity baseEntity;
	
	@Transactional
	public Boolean call()  {
		getEntityManager().remove(getEntityManager().merge(baseEntity));
		return true;
	}

	public BaseEntity getBaseEntity() {
		return baseEntity;
	}
	public void setBaseEntity(BaseEntity baseEntity) {
		this.baseEntity = baseEntity;
	}
}